﻿
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link href="~/Content/bootcss/css/bootstrap-switch.css" rel="stylesheet" />
<script src="~/Content/bootcss/js/bootstrap-switch.min.js" type="text/javascript"></script>
<script>
    $(function () {
        $("[name='my-checkbox']").bootstrapSwitch();
        gridListData([]);
        $(".moreInfo").hide();
        $("#disBtn").click(function () {
            $(".moreInfo").fadeToggle();//.show();
            if ($(this).hasClass("fa-angle-double-up")) {
                $(this).removeClass("fa-angle-double-up");
                $(this).addClass("fa-angle-double-down");
            } else if ($(this).hasClass("fa-angle-double-down")) {
                $(this).removeClass("fa-angle-double-down");
                $(this).addClass("fa-angle-double-up");
            }

        });
    });

    //绑定grid
    function gridListData(mydata) {
        var captionCon = "项目信息";
        captionCon += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;项目总额：" + "" + "元&nbsp;&nbsp;&nbsp;&nbsp;当前项目金额：" + "" + "元";

        var $gridList = $("#gridList");
        $gridList.newtouchLocalDataGrid({
            height: $(window).height() - 375,
            unwritten: false,
            shrinkToFit: true,
            caption: captionCon,
            colModel: [
                { label: "主键", name: "patid", hidden: true },
                  { label: '类别', name: 'lb', width: 100, align: 'left', editor: "text" },
                    { label: '科室', name: 'ks', width: 100, align: 'left', editor: "text" },
                      { label: '住院号', name: 'zyh', width: 100, align: 'left', editor: "text" },
                       { label: '床号', name: 'ks', width: 100, align: 'left', editor: "text" },
                   { label: '治疗师', name: 'name', width: 100, align: 'left', editor: "text" },
                   { label: '姓名', name: 'patname', width: 100, align: 'left', editor: "text" },
                //{ label: '替代项目', name: 'ReplaceTtemName', width: 100, align: 'left', editor: "text" },
                { label: '备注', name: 'Remark', width: 150, align: 'left', editor: "text" },
                { label: '治疗项目', name: 'ItemName', width: 300, align: 'left', editor: "text" },
                   { label: '时间', name: 'sj', width: 100, align: 'left', editor: "text" },
                { label: '单位', name: 'Unit', width: 100, align: 'left', editor: "text" },
                { label: '单价', name: 'UnitPrice', width: 100, align: 'left', editor: "text" },
                { label: '自付比例', name: 'zfbl', width: 100, align: 'left', editor: "text", },
                { label: '数量', name: 'ItemCount', width: 100, align: 'left', editor: "text" },
                { label: '金额', name: 'Total', width: 100, align: 'left', editor: "text" },

            ]
        });

        var mydata = [{ sl: "1001", ItemName: "红外线治疗", Replacesl: "1001", ReplaceTtemName: "", ItemCount: "1", Unit: "部位", SingleTimeLength: "30", UnitPrice: "20", Total: "20", Remark: "运动替代红外线治疗", name: "李慧Coco", ks: "内一科", lb: "PT+OT", zyh: "164193", ch: "4", patname: "张三", sj: "20m" },
            { zfbl: "0", ItemName: "运动治疗", Replacesl: "2001", ReplaceTtemName: "激光疗法", ItemCount: "1", Unit: "部位", SingleTimeLength: "5", UnitPrice: "10", Total: "10", Remark: "激光治疗代替运动", name: "李慧Coco", ks: "康复科", lb: "PT+OT", zyh: "163887", ch: "10", patname: "吴道华", sj: "20m" },
    { zfbl: "0", ItemName: "运动治疗", Replacesl: "2002", ReplaceTtemName: "低频脉冲电治疗", ItemCount: "2", Unit: "部位", SingleTimeLength: "10", UnitPrice: "20", Total: "40", Remark: "低频脉冲电治疗代替运动", name: "李慧Coco", ks: "内二科", lb: "PT+OT", zyh: "162514", ch: "5", patname: "吴国忠", sj: "20m" },
    { zfbl: "0", ItemName: "神经肌肉电刺激治疗", Replacesl: "", ReplaceTtemName: "", ItemCount: "1", Unit: "部位", SingleTimeLength: "5", UnitPrice: "10", Total: "10", Remark: "", name: "李慧Coco", ks: "内二科", lb: "PT+OT", zyh: "162514", ch: "5", patname: "吴国忠", sj: "20m" },
    { zfbl: "0", ItemName: "中频脉冲电治疗", Replacesl: "", ReplaceTtemName: "", ItemCount: "1", Unit: "部位", SingleTimeLength: "20", UnitPrice: "30", Total: "30", Remark: "", name: "李慧Coco", ks: "内二科", lb: "PT+OT", zyh: "162514", ch: "5", patname: "吴国忠", sj: "20m" },
    { zfbl: "0", ItemName: "立体动态干扰电治疗", Replacesl: "2003", ReplaceTtemName: "超短波（小功率）", ItemCount: "1", Unit: "部位", SingleTimeLength: "", UnitPrice: "8", Total: "8", Remark: "超短波（小功率）代替立体动态干扰电治疗", name: "李慧Coco", ks: "内二科", lb: "PT+OT", zyh: "162514", ch: "5", patname: "吴国忠", sj: "20m" },
    { zfbl: "0", ItemName: "立体动态干扰电治疗", Replacesl: "2004", ReplaceTtemName: "超短波（大功率）", ItemCount: "1", Unit: "部位", SingleTimeLength: "", UnitPrice: "8", Total: "10", Remark: "超短波（大功率）代替立体动态干扰电治疗", name: "李慧Coco", ks: "内二科", lb: "PT+OT", zyh: "162514", ch: "5", patname: "吴国忠", sj: "20m" },
    { zfbl: "0", ItemName: "立体动态干扰电治疗", Replacesl: "2005", ReplaceTtemName: "超短波（脉冲）", ItemCount: "1", Unit: "部位", SingleTimeLength: "", UnitPrice: "8", Total: "10", Remark: "超短波（脉冲）代替立体动态干扰电治疗", name: "李慧Coco", ks: "内二科", lb: "PT+OT", zyh: "162514", ch: "5", patname: "吴国忠", sj: "20m" },
    { zfbl: "0", ItemName: "立体动态干扰电治疗", Replacesl: "2006", ReplaceTtemName: "超短波（小功率）（≥3照射区）", ItemCount: "1", Unit: "", SingleTimeLength: "", UnitPrice: "24", Total: "10", Remark: "超短波（小功率）（≥3照射区）代替立体动态干扰电治疗", name: "李慧Coco", ks: "内二科", lb: "PT+OT", zyh: "162514", ch: "5", patname: "吴国忠", sj: "20m" },
    { zfbl: "0", ItemName: "立体动态干扰电治疗", Replacesl: "2007", ReplaceTtemName: "超短波（大功率）（≥3照射区）", ItemCount: "1", Unit: "", SingleTimeLength: "", UnitPrice: "24", Total: "10", Remark: "超短波（大功率）（≥3照射区）代替立体动态干扰电治疗", name: "李慧Coco", ks: "内二科", lb: "PT+OT", zyh: "162514", ch: "5", patname: "吴国忠", sj: "20m" },
    { zfbl: "0", ItemName: "微波治疗", Replacesl: "2008", ReplaceTtemName: "微波治疗（≥3照射区）", ItemCount: "1", Unit: "部位", SingleTimeLength: "5", UnitPrice: "10", Total: "10", Remark: "激光治疗代替微波治疗", name: "李慧Coco", ks: "内二科", lb: "PT+OT", zyh: "162514", ch: "5", patname: "吴国忠", sj: "20m" },
    { zfbl: "0", ItemName: "微波治疗", Replacesl: "2009", ReplaceTtemName: "单纯超声波", ItemCount: "1", Unit: "部位", SingleTimeLength: "5", UnitPrice: "10", Total: "10", Remark: "微波治疗（≥3照射区）代替微波治疗", name: "李慧Coco", ks: "内二科", lb: "PT+OT", zyh: "162514", ch: "5", patname: "吴国忠", sj: "20m" },
    { zfbl: "0", ItemName: "牵引（颈牵引）", Replacesl: "", ReplaceTtemName: "", ItemCount: "1", Unit: "部位", SingleTimeLength: "5", UnitPrice: "10", Total: "10", Remark: "", ks: "内二科", lb: "PT+OT", zyh: "162514", ch: "5", patname: "吴国忠", sj: "20m" }];
        for (var i = 0; i <= mydata.length; i++) {
            $gridList.jqGrid('addRowData', i + 1, mydata[i]);
        }
    }

    //选择模板
    function GetTemplate() {
        $.modalOpen({
            id: "Form",
            title: "收费项目模板窗口",
            url: "/BookkeepInHos/ChargeItemTemplate",
            width: "700px",
            height: "570px"
        });
    }
    function newtouch_event_f6() {
        GetTemplate();
    }

    function getMorePatientInfo() {
        $.modalOpen({
            id: "Form",
            title: "更多信息",
            url: "/TherapeutistCompleteList/MorePatientInfo",
            width: "900px",
            height: "260px",
            callBack: function (iframeId) {
                top.frames[iframeId].submitForm();
            }
        });
    }


    //患者登记
    function AddNewPatient() {
        $.modalOpen({
            id: "Form",
            title: "患者登记",
            url: "/Patient/AddPatient",
            width: "1000px",
            height: "824px",
            callBack: function (iframeId) {
                top.frames[iframeId].submitForm();
            }
        });
    }
</script>
<style>
    /*span {
        color: red;
    }*/

    .active {
        background: rgb(238, 238, 238) !important;
    }
</style>
<form id="form1" class="form">
    <div class="rows" style="margin-bottom: 10px;margin-right:5px;" id="HosBasicInfo">
        <div class="panel panel-default">
            <div class="panel-heading">
                住院病人信息
            </div>
            <table style="width:100%" class="form">
                <tr>
                    <td class="formTitle">卡号:</td>
                    <td class="formValue">
                        <input type="text" id="txtINPUTCODE" class="form-control" placeholder="卡号" />
                    </td>
                    @*<td style="width:62px"><input type="button" class="btn btn-default btn-md" value="新增患者" onclick="AddNewPatient()" /></td>*@
                    <td class="formTitle">
                        住院号:
                    </td>
                    <td class="formValue">
                        <input type="text" id="zyh" class="form-control" />
                    </td>
                    <td class="formTitle">
                        姓名:
                    </td>
                    <td class="formValue">
                        <input type="text" id="brxzmc" class="form-control" />
                    </td>
                    <td class="formTitle">
                        诊断:
                    </td>
                    <td class="formValue">
                        <input type="text" id="kh" class="form-control" />
                    </td>
                    <td class="formTitle">
                        有效期:
                    </td>
                    <td class="formValue">
                        <input id="Jssj" type="text" class="form-control input-wdatepicker" value="@DateTime.Now.ToString("yyyy-MM-dd")" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
                    </td>

                </tr>
                <tr class="moreInfo">
                    <td class="formTitle">
                        病人性质:
                    </td>
                    <td class="formValue">
                        <input type="text" id="brxzmc" class="form-control newtouch_Readonly" value="自费" />
                    </td>
                    @*<td></td>*@
                    <td class="formTitle">
                        证件类型:
                    </td>
                    <td class="formValue">
                        <input type="text" id="zybz" class="form-control newtouch_Readonly" value="身份证" />
                    </td>
                    <td class="formTitle">证件号:</td>
                    <td class="formValue">
                        <input type="text" id="cw" class="form-control newtouch_Readonly" value="420281199305022429" />
                    </td>
                    <td class="formTitle">出生日期:</td>
                    <td class="formValue">
                        <input class="form-control newtouch_Readonly" readonly="readonly" type="text" value="1993-05-02" id="csny" />
                    </td>
                    <td class="formTitle">状态:</td>
                    <td class="formValue">
                        <input class="form-control newtouch_Readonly" type="text" value="在院" />
                    </td>
                </tr>
                <tr id="markdis">
                    <td colspan="10">
                        <div style="background-color:#fcfcfc; color:#00a0ea; height:15px; text-align:center"><label id="disBtn" class="fa fa-angle-double-down"></label></div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="panel panel-default" style="margin-bottom: 1%; display: none">
        <div class="panel-heading">
            <table>
                <tr>
                    <td style="color: red">预交金:</td>
                    <td class="formTitle">未结金额:<label id="wjje">0.00</label>元</td>
                    <td class="formTitle">剩余金额:<label id="zhye">0.00</label>元</td>
                </tr>
            </table>
        </div>
    </div>
    @Html.Partial("../ChargeItem/Index")
    @*<div id="BookKeep" class="rows">
            <div class="panel panel-default" style="margin-bottom: 0;">
                <div class="panel-heading">
                    治疗信息
                </div>
                <table class="form" style="width:95%">
                    <tr>

                        <td class="formTitle">
                            治疗项目:<span>*</span>
                        </td>
                        <td class="formValue">
                            <input type="text" id="sfxm" class="form-control sfxm" onkeydown="loadGrid()" />
                        </td>
                        <td class="formTitle">
                            数量:<span>*</span>
                        </td>
                        <td class="formValue">
                            <input type="text" id="sl" class="form-control" onkeydown="loadGrid()" />
                        </td>
                        <td class="formTitle">
                            单价:
                        </td>
                        <td class="formValue">
                            <input type="text" id="dj" class="form-control newtouch_Readonly" />
                        </td>
                        <td class="formTitle">
                            治疗师:<span>*</span>
                        </td>
                        <td class="formValue">
                            <input type="text" id="doctor" class="form-control" onkeydown="loadGrid()" />
                        </td>
                        <td class="formTitle">
                            开始时间:<span>*</span>
                        </td>
                        <td class="formValue">
                            <input id="jzrq" type="text" class="form-control input-wdatepicker"
                                   onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" style="width: 115%" />
                        </td>
                    </tr>
                    <tr>
                        <td class="formTitle">
                            时长:(分)
                        </td>
                        <td class="formValue">
                            <input type="text" id="sl" class="form-control" onkeydown="loadGrid()" />
                        </td>
                        <td class="formTitle"></td>
                        <td class="formValue">
                            <div class="switch">
                                <input type="checkbox" name="my-checkbox" data-size="mini" />
                            </div>
                        </td>
                    </tr>
                </table>

                @Html.Partial("_BottomButtonsView", new Newtouch.HIS.Web.Core.Models.BottomButtonViewModel
           {
               ShowKeyList = new int[] { 6, 7, 8 },
               F6Text = "添加",
               F7Text = "修改",
               F8Text = "删除"
           })
            </div>

        </div>*@
    @*<div class="gridPanel" style="margin-top:50px">
            <table id="gridList"></table>
        </div>*@
    @*@Html.Partial("_BottomButtonsView", new Newtouch.HIS.Web.Core.Models.BottomButtonViewModel
        {
            ShowKeyList = new int[] { 4, 9 },
            F9Text = "保存"
        })*@
</form>

